package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 勋章信息表
 */
@Entity
@Getter
@Setter
@ToString
@DynamicInsert
@DynamicUpdate
@ApiModel("勋章信息表")
@Table(name = "medal_info")
public class MedalInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("勋章名称")
    @Column(name = "name", nullable = false)
    @NotBlank(message = "勋章名称不能为空")
    private String name;

    @ApiModelProperty("勋章简介")
    @Column(name = "introduction")
    private String introduction;

    @ApiModelProperty("图标url")
    @Column(name = "icon_url", nullable = false)
    @NotBlank(message = "图标url不能为空")
    private String iconUrl;

    @ApiModelProperty("状态 1-生效 0-失效")
    @Column(name = "status", nullable = false)
    private String status;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

}
